home *** CD-ROM | disk | FTP | other *** search
Wrap
; $VER: Installation script for Warp3D 1.0 ( 5. Dezember 1998) ; © Thomas & Hans-Jörg Frieden ; Created with GoldED 5.0 ; Adapted for V2 beta, 04-Feb-99 ; check if we are running under correct OS (set #version (/ @installer-version 65536)) (if (< (/ (getversion) 65536) 39) ( (abort "Incorrect OS version (software requires OS 39 or better )!") ) ) ; error handling ; ; Procedure to copy a single library (procedure P_copy_single arg1 arg2 arg3 (copylib (confirm) (prompt arg3) (help @copylib-help) (source arg1) (dest arg2) (optional "oknodelete" "askuser") ) ) ; ; How can it be there's no way of specifying an environment variable? (procedure P_setenv arg1 arg2 ( (if (exists (tackon "ENV:" arg1) (noreq)) (delete (tackon "ENV:" arg1)) ) (if (exists (tackon "ENVARC:" arg1) (noreq)) (delete (tackon "ENVARC:" arg1)) ) (textfile (dest (tackon "ENV:" arg1)) (append arg2) ) (textfile (dest (tackon "ENVARC:" arg1)) (append arg2) ) ) ) ; ; Procedure to invalidate old version (procedure P_invalidate (if (exists "libs:Warp3D" (noreq)) ( if (< (getversion "libs:Warp3D.library") 196608) ( (message (cat "The installer will now invalidate your old installation by moving " "old files to a directory old_warp3d. Note that the old libraries " "are no longer compatible with V2") ) ; make backup directory (makedir "libs:old_warp3d") (makedir "libs:old_warp3d/Warp3D") ; copy old stuff (copyfiles (source "Libs:Warp3D") (dest "Libs:old_warp3d/Warp3D") (infos) (all) (optional "nofail" "force" "askuser") ) (copyfiles (source "Libs:Warp3D.library") (dest "Libs:old_warp3d") (infos) (all) (optional "nofail" "force" "askuser") ) (copyfiles (source "Libs:Warp3DPPC.library") (dest "Libs:old_warp3d") (infos) (all) (optional "nofail" "force" "askuser") ) ; delete old files (delete "libs:Warp3D.library" (optional "force")) (delete "libs:Warp3DPPC.library" (optional "force")) (delete "libs:Warp3D/GFXdrivers/#?" (optional "force")) (delete "libs:Warp3D/HWdrivers/#?" (optional "force")) (delete "libs:Warp3D/GFXdrivers" (optional "force")) (delete "libs:Warp3D/HWdrivers" (optional "force")) (delete "libs:Warp3D/" (optional "force")) (message (cat "The old libraries can now be found in libs:old_warp3d." "If you experience any problem with V2, you may uninstall it " "and use the old_warp3d files again. Otherwise, you may delete " "the old_warp3d directory") ) ) ) ) ) (if (>= #version 44) ( (effect "center" "radial" $ffffff $ffffff) (showmedia "w3d" "Installer_Media/Warp3D.jpg" "upper_left" "none" 0) (showmedia "3dw" "Installer_Media/3DWorld.jpg" "upper_right" "none" 0) ) ) (onerror (if (> @ioerr 0) ( (message ("An error has occurred during installation. Please check the log file to understand the error.") ) ) ) (exit (quiet)) ) (set #installmode (askbool (prompt (cat "Welcome to Warp3D.\n" "Choose the installation mode.\n\n" "If you have an older version of Warp3D installed, " "you may want to choose uninstall now to avoid confusion with older drivers." ) ) (help "Select Install if you want to install Warp3D, and Uninstall if you want to remove it. Warp3D is a hardware independent driver system for 3d accelerators.") (choices "Install" "Uninstall" ) (default 1) ) ) (if (= #installmode 1) ; normal installation ( (welcome (cat "Welcome to the Warp3D installation. This utility will install or " "update Warp3D, the hardware-independent 3D driver system, on your " "Amiga. ") ) (P_invalidate) (message "The Installation program will now create a new directory \"Warp3D\" in your LIBS directory where the Warp3D libraries will be installed.") (makedir "Libs:Warp3D/") (makedir "Libs:Warp3D/GFXdrivers") (makedir "Libs:Warp3D/HWdrivers") ; --- Try to find out if WarpUp is installed. (if (exists "libs:Warp.library" (noreq)) (set #ppc 1) (set #pcc 0) ) (if (= #ppc 1) (set #result (askbool (prompt "You seem to have WarpUp installed. Warp3D comes with a special PPC version that is usable for WarpUp applications. Do you want to install the PPC libraries, too?") (help @askbool-help) (choices "Yes" "No") (default 1) ) ) (if (= #result 0) (set #ppc 0) ) ) (copylib (prompt "Copying the master library") (help @copylib-help) (source "libs/Warp3D.library") (dest "libs:") ) (if (= #ppc 1) (copylib (prompt "Copying the PPC master library") (help @copylib-help) (source "libs/Warp3DPPC.library") (dest "libs:") ) ) ; ask for graphics driver (set #gfx_sys (askoptions (prompt "Which graphics systems do you want to use with Warp3D ?") (help @askoptions-help) (choices "CyberGraphX V3/V4" "Picasso96" ) (default (+ 1 2)) ) ) ; if P96 is selected, install it (if (BITAND #gfx_sys 2) ( (P_copy_single "libs/Warp3D/gfxdrivers/W3D_Picasso96.library" "libs:Warp3D/GFXdrivers" "Copy Picasso96 driver" ) (if (= #ppc 1) (P_copy_single "libs/Warp3D/gfxdrivers/W3D_Picasso96_PPC.library" "libs:Warp3D/GFXdrivers" "Copy Picasso96 driver (PPC version)" ) ) ) ) ; same for CGX, but ask for version first (if (BITAND #gfx_sys 1) ( (set #result (askchoice (prompt "What version of CyberGraphX do you have installed ?\n") (help @askchoice-help) (choices "CyberGraphX V3 (for CyberVision3D)" "CyberGraphX V3 (for CVPPC/BVPPC)" "CyberGraphX V4" ) (default 2) ) ) ; assume the V4 driver will be installed, except when CVision3D is selected (set #version 1) (if (= #result 0) (set #version 0) ) (if (= #version 0) ( (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGFX.library" "libs:Warp3D/GFXdrivers" "Copy CyberGraphX V3 driver" ) (if (= #ppc 1) (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGFX_PPC.library" "libs:Warp3D/GFXdrivers" "Copy CyberGraphX V3 driver (PPC version)" ) ) ) ( (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGfx4.library" "libs:Warp3D/GFXdrivers" "Copy CyberGraphX V4 driver" ) (if (= #ppc 1) (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGfx4_PPC.library" "libs:Warp3D/GFXdrivers" "Copy CyberGraphX V4 driver (PPC version)" ) ) ) ) ) ) ; Try to find out the graphics card, assuming CVision3D (set #graka 0) (if (exists "devs:Monitors/CVision3D" (noreq)) (set #graka 0) ) (if (exists "devs:Monitors/CVisionPPC" (noreq)) (set #graka 1) ) ; Ask for graphics card (set #result (askchoice (prompt "Please select the graphics device you want to use.") (help @askchoice-help) (choices "CyberVision64/3D" "CyberVisionPPC/BlizzardVisionPPC" ) (default #graka) ) ) (select #result ( (set #grdrv "libs/Warp3D/HWdrivers/W3D_Virge.library") (set #grdrv2 "libs/Warp3D/HWdrivers/W3D_Virge_PPC.library") ) ( (set #grdrv "libs/Warp3D/HWdrivers/W3D_Permedia2.library") (set #grdrv2 "libs/Warp3D/HWdrivers/W3D_Permedia2_PPC.library") ) ) (copylib (prompt "Copying the hardware driver library") (help @copylib-help) (source #grdrv) (dest "libs:Warp3D/HWdrivers") ) (if (= #ppc 1) (copylib (prompt "Copying the PPC hardware driver library") (help @copylib-help) (source #grdrv2) (dest "libs:Warp3D/HWdrivers") ) ) (if (= #result 1) ( ; Take special steps for Permedia driver (makedir "ENV:Warp3D") (makedir "ENV:Warp3D/Permedia2") (makedir "ENVARC:Warp3D") (makedir "ENVARC:Warp3D/Permedia2") (P_setenv "Warp3D/Permedia2/Dither" "on") (set #result (askbool (prompt (cat "For the Permedia2 driver to work correctly, semaphore " "locking is required. This is done by setting the environment " "variable CyberGraphX/USESEMAPHORES to 1. See the documentation for more details. " "Should the installer program do this now ?") ) (help @askbool-help) (choices "Yes" "No" ) (default 1) ) ) (if (= #result 1) (P_setenv "CyberGraphX/USESEMAPHORES" "1" ) (message "Ok, but remember that you may run into troubles later!") ) ) ) ; Ask for demo installation (set #result (askbool (prompt "Do you want to install the demo?") (help @askbool-help) (choices "Yes" "No" ) (default 1) ) ) (if (= #result 1) ( (set #demodest (askdir (prompt "Select a location to install the Demo. A Drawer \"W3DDemo\" will be created") (help @askdir-help) (newpath) (default "ram:") ) ) (if (NOT (exists #demodest)) (makedir #demodest) ) (copyfiles (source "demo/") (dest (tackon #demodest "W3DDemo")) (infos) (all) (optional "oknodelete" "force" "askuser") ) ) ) (set #result (askbool (prompt "Do you want to Install the User's Guide?") (help @askbool-help) (choices "Yes" "No" ) (default 1) ) ) (if (= #result 1) ( (set #destdoc (askdir (prompt "Select the place to install the documentation. A drawer \"docs\" will be created.") (help @askdir-help) (newpath) (default "HELP:") ) ) (copyfiles (prompt "Copying documentation files") (help @copyfiles-help) (source "Docs") (infos) (all) (dest (tackon #destdoc "Docs")) ) ) ) (exit "Warp3D has been installed on your system.\n" "For more information on Warp3D, check out the 3d World website:\n" "http://www.haage-partner.com/3dworld\n" "You'll also find information on how to subscribe to the " "3DWorld mailing list.\n\n" "Have fun with Warp3D!") ) ; uninstall application ( ; --- insert your code below --- (delete "libs:Warp3D.library" (optional "force")) (delete "libs:Warp3DPPC.library" (optional "force")) (delete "libs:Warp3D/GFXdrivers/#?" (optional "force")) (delete "libs:Warp3D/HWdrivers/#?" (optional "force")) (delete "libs:Warp3D/GFXdrivers" (optional "force")) (delete "libs:Warp3D/HWdrivers" (optional "force")) (delete "libs:Warp3D/" (optional "force")) ; -- end of your code --- (message "Uninstallation completed. The demo and documentation must be deleted manually.") (exit (quiet)) ) )